/*
 *  random.c
 *  StringSearch
 *
 *  Created by Mohammad H. Afrasiabi on 09-11-28.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */


#include <stdlib.h>
#include <string.h>

#include "rand.h"

void randStr(char * buf, int size, const char * pat, int step)
{
	int i;
	for (i = 1; i < size - 1; i++)
		if (i % step == 0)
		{
			strcpy(&buf[i], pat);
			i += strlen(pat)-1;
		}
		else
			buf[i] = 'A' + (rand() % 24);
	buf[size-1] = 0;
}